@import '../../style/index.scss';
$badge: 'uni-badge';

.#{$badge} {
  display: inline-block;
  position: relative;

  &-count {
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
    height: 20px;
    border-radius: 10px;
    min-width: 20px;
    background: $color-brand-normal;
    color: #fff;
    line-height: 20px;
    text-align: center;
    padding: 0 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    -webkit-box-shadow: 0 0 0 1px #fff;
    box-shadow: 0 0 0 1px #fff;
    z-index: 10;
  }

  &-dot {
    height: 6px;
    width: 6px;
    border-radius: 100%;
    background: $color-brand-normal;
    z-index: 10;
    -webkit-box-shadow: 0 0 0 1px #fff;
    box-shadow: 0 0 0 1px #fff;
    position: absolute;
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
  }

  &-success {
    .#{$badge}-dot {
      background-color: $color-success-deep;
    }
  }

  &-error {
    .#{$badge}-dot {
      background-color: $color-error-deep;
    }
  }

  &-warning {
    .#{$badge}-dot {
      background-color: $color-warning-deep;
    }
  }

  &-process {
    .#{$badge}-dot {
      background-color: $color-notice-deep;
    }
  }

  &-default {
    .#{$badge}-dot {
      background-color: $color-line-deep;
    }
  }

  &-no-wrapper {
    .#{$badge}-count {
      display: block;
      position: relative;
      top: auto;
      right: auto;
      transform: none;
    }
  }
}
